Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git] / 913 - Joana and the Odd Numbers / 913.cpp
blob4abc771d1c03759ad026fc4601e770cd6819388f
1 /*
2 Problem:
3 Andrés Mejía-Posada (andmej@gmail.com)
4 */
5 using namespace std;
6 #include <algorithm>
7 #include <iostream>
8 #include <iterator>
9 #include <sstream>
10 #include <fstream>
11 #include <numeric>
12 #include <cassert>
13 #include <climits>
14 #include <cstdlib>
15 #include <cstring>
16 #include <string>
17 #include <cstdio>
18 #include <vector>
19 #include <cmath>
20 #include <queue>
21 #include <deque>
22 #include <stack>
23 #include <list>
24 #include <map>
25 #include <set>
27 #define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
28 #define For(i, a, b) for (int i=(a); i<(b); ++i)
29 #define D(x) cout << #x " is " << x << endl
31 int main(){
32 long long n;
33 while (cin >> n){
34 long long i = (n-1)*(n-1)/4 + n - 3;
35 cout << 6*i + 9 << endl;
37 return 0;